package com.lss.cloud.controller;

import com.lss.cloud.Resp.ResultData;
import com.lss.cloud.service.StorageService;
import jakarta.annotation.Resource;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * 2024/3/26-23:05
 * 功能:
 */
@RestController
@Slf4j
public class StorageController {
    @Resource
    private StorageService service;
    @RequestMapping("/storage/decrease")
    public ResultData decrease(Long productId, Integer count) {

        service.decrease(productId, count);
        return ResultData.success("扣减库存成功!");
    }
}
